<template>
	<view id="paper-work" class="digital-page">
		<back-btn></back-btn>
		<view class="banner">
			<view class="title-area">
				<div class="title-cn">文书档案</div>
				<div class="title-en">Paperwork</div>
			</view>
		</view>
		<view class="main-content">
			<view class="header">
				文书档案
			</view>
			<view class="divider-h"></view>
			<scroll-view class="scroll" scroll-x="true">
				<navigator class="item" v-for="(v,k) in row">
					<view class="upper">
						<view class="topic">
							{{v.Topic}}
						</view>
						<image :src="baseUrl+v.FeaturedImage" class="cover"></image>
					</view>
					<view class="desc">
						{{v.Abstract}}
					</view>
				</navigator>
			</scroll-view>
		</view>
	</view>
</template>

<script>
	// 姚珅 @ 2023年5月8日 绑定 (数据不完整)
	// 姚珅 @ 5月21日 返回组件添加以及绑定修改
	import useCategory from '@/stores/digitalPlatform/useServerData'
	import backBtn from './back.vue'
	export default {
		components: {
			backBtn
		},
		data() {
			return {
				row:[],
				baseUrl: ""
			}
		},
		onLoad(opt){
			let promise = useCategory(opt.title || "文书档案");
			promise.then(msg => {
				this.baseUrl = msg.baseUrl;
				this.row = msg.data.upper;
				console.log(this.row);
			})
		}
	}
</script>

<style lang="less">
	@import url(shared.less);
	@topic-size: 60rpx;
	#paper-work {
		.scroll {
			white-space: nowrap;
			.item {
				
				display: inline-block;
				width: 290rpx;
				height: 545rpx;
				margin-right: 10rpx;
				.upper {
					position: relative;
					.topic {
						
						z-index: 999;
						position: absolute;
						margin: auto;
						top: 0;
						bottom: 0;
						left: 0;
						right: 0;
						
						white-space: normal;
						width: @topic-size*2;
						height: @topic-size*3;
						font-size: @topic-size;
						color: #fff;
					}
					.cover {
						object-fit: cover;
						width: 290rpx;
						height: 407rpx;
						margin-bottom: 20rpx;
						border-radius: 5px;
					}
				}
				.desc {
					height: 120rpx;
					width: 290rpx;
					white-space: pre-wrap;
					.text-cut(3);
					line-height: 40rpx;
					color: #fff;
				}
			}
		}
	}
</style>
